/*    */ package com.zimbra.cs.stats;
/*    */ 
/*    */ import com.google.common.collect.Maps;
/*    */ import com.zimbra.common.jetty.JettyMonitor;
/*    */ import com.zimbra.common.stats.RealtimeStatsCallback;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.LogFactory;
/*    */ import java.util.Map;
/*    */ import org.eclipse.jetty.util.thread.ThreadPool;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class JettyStats
/*    */   implements RealtimeStatsCallback
/*    */ {
/* 36 */   private static Log log = LogFactory.getLog(JettyStats.class);
/*    */   
/*    */   public Map<String, Object> getStatData()
/*    */   {
/* 40 */     ThreadPool pool = JettyMonitor.getThreadPool();
/* 41 */     if (pool == null) {
/* 42 */       log.debug("Thread pool has not been initialized.  Not returning stat data.");
/* 43 */       return null;
/*    */     }
/* 45 */     Map<String, Object> data = Maps.newHashMap();
/* 46 */     data.put("http_threads", Integer.valueOf(pool.getThreads()));
/* 47 */     data.put("http_idle_threads", Integer.valueOf(pool.getIdleThreads()));
/* 48 */     return data;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/stats/JettyStats.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */